import * as React from 'react';
import TableList from './TableList'
import { connect } from 'umi'
import { IPro } from './pro';
interface IAppProps {
  proList: IPro[],
  dispatch: any
}

const App: React.FunctionComponent<IAppProps> = (props) => {
  React.useEffect(() => {
    props.dispatch({
      type: 'pro/getProList'
    })
  }, [])
  return (
    <div>

      <TableList proList = { props.proList } />

    </div>
  );
};

export default connect(({ pro: { proList }}: any) => ({proList}))(App);
